<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>50bus-创意发布</title>
    <meta name="keywords" content="50bus" />
    <meta name="copyright" content="50bus.cn" />
    <!-- <meta http-equiv="mobile-agent" content="http://www.50bus.cn/" />
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" /> -->
    <link rel="icon" href="/resources/img/favicon.ico" type="image/x-icon" />
    <link href="/resources/static/css/bootstrap.css" rel="stylesheet" media="screen"/>
    <link rel="stylesheet" href="/resources/static/css/ipaper.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="/resources/css/base.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/globe.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/page.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/module-creative.css" media="all" />
    <script type="text/javascript" src="/resources/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/resources/js/jquery.pagination.js"></script>
    <script type="text/javascript" src="/resources/static/js/processing.js"></script>
    <script type="text/javascript" src="/resources/static/js/pixastic.core.js"></script>
    <script type="text/javascript" src="/resources/static/js/pixastic.jquery.js"></script>
    <script type="text/javascript" src="/resources/static/js/brightness.js"></script>
    <script type="text/javascript" src="/resources/static/js/desaturate.js"></script>
    <script type="text/javascript" src="/resources/static/js/main-wanglei.js"></script> 

    <!--<script type="text/javascript">
        var $SCRIPT_ROOT = { request.script_root|tojson|safe };
    </script>-->
</head>

<body>
    <div class="header_wrap">
        <div class="header clearfix">
            <div class="fm980 fl clearfix">
                <a href="/index.html" class="logo fl"></a>
                <ul class="nav_box fl">
                    <li><a href="/creative_list.html"  class="cur">形象创意</a></li>
                    <li><a href="/script_list.html">剧本创作</a></li>
                    <li><a href="/render_index.html">动画渲染</a></li>
                    <li><a href="/creative_helper.html">创意助手</a></li>
                </ul>
                <div class="about_box fr">
                    <a href="/about.html">关于我们</a>
                    <#if uid??&&uid!="">
	                    <a href="/user/user_work.html">个人空间</a>
	                    <a href="/logout.html">退出</a>
                    <#else>
	                    <a href="/register.html">注册</a>
	                    <a href="/login.html">登录</a>
                    </#if>
                </div>
            </div>
        </div>
    </div>
    <div class="body_wrap">
        <div class="box_2 box_3" style="overflow:hidden;">
            <div class="handle_bar">
                <div class="fm980 clearfix">
                	<#if user??>
                    	<a class="btn_com_red fl" href="creative_publish.html"><i class="icon_add"></i>创意发布</a>
                    </#if>
                    <div class="searchbox fr">
                        <input type="button" value="" class="sc_btn sc_draw_btn fl" />
                        <form action="creative_list.html" id="search_form" method="post">                                           
                        	<input id="search" type="text" name="keyword" class="sc_txt fl" value="${keyword}" placeholder="请输入标题、作者、描述" />
                        	<input id="mids" type="hidden" name="mids" value=""/>
                            <input id="submitBtn" type="button" value="" class="sc_btn sc_txt_btn fl" />
                        </form>
                    </div>
                </div>
            </div>
            
            <!-- 画板 -->
            <div class="draw_board" style=" display:none; position:relative;">
            	<b class="def_txt"></b>
                <div id="dropzone" class="vbox"></div>  
                <div id="dropImg"></div>
                
                <canvas id="shadowImg" width="750" height="290"></canvas>
                
                <div id="slide" style="display:none">
                    <div class="slides">
                        <canvas id="whiteboard0" resize class="wboard step slide rebuild present"></canvas>
                        <canvas id="whiteboard1" resize class="wboard step slide rebuild future"></canvas>
                        <canvas id="whiteboard2" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard3" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard4" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard5" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard6" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard7" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard8" resize class="wboard step slide rebuild"></canvas>
                        <canvas id="whiteboard9" resize class="wboard step slide rebuild"></canvas>
                    </div>
                </div>
                <div id="loading" style="display:none">
                    <img src="/resources/static/images/loading.gif"/>
                </div>
                
                <ul class="buttons br-b10" style="display:none;">
                    <li><button type="button" class="brushBtn sel"></button></li>
                    <li><button type="button" class="eraseBtn"></button></li>
                    <li><button type="button" class="clearBtn"></button></li>
                    <li class="line"></li>
                    <li><button type="button" class="searchBtn"></button></li>
                    <li><button type="button" class="closeBtn"></button></li>
                </ul>
                <div id="imgs">
                    
                </div>
            </div>
            
            <div class="box_bd">
                <div class="fm980">
                    <ul class="works_show_list clearfix" style="min-height:400px;height:auto!important;height:400px;">
                    	<#assign index = 0>
                       	 <#list creativeList as creative>
                       	  <li>
                        	<a href="creative_detail.html?cid=${creative.cid}&uid_creative=${creative.uid}">
                            <div class="works_show">
                                <div class="works_img"><#if creative.cover_url??&&creative.cover_url!=""> <img style="width:214px;height:132px;" src="${creative.cover_url}" /><#else><img src="/resources/img/eg_works_214.png"/></#if></div>
                                <div class="works_type_box clearfix">
                                    <span class="works_type fl" style="display:none;">卡通类</span>
                                    <span class="like_box fr">${creative.addlike}<b class="fav_heart"></b></span>
                                </div>
	                                <div class="works_name">${creative.title}</div>
	                                  <#assign index = index+1>
	                                  <#if index<=4 && pageIndex ==1>
	                                	<!--<i class="icon_new"></i>-->
	                                  </#if>
	                                	<i class="price_box">&yen;${creative.cvalue}</i>
                            </div>
                            </a>
                            <#list userList as user>
                              <#if creative.uid==user.uid>
                                <p class="user_name clearfix">
                                 <#if user.header_img?? && user.header_img!=''>
                                  <img class="r10 fl" style="width:20px;height:20px;" src="${user.header_img}" /><span class="fz14 ml5 fl"><a href="#">${user.comp}</a></span>
	                             <#else>
	                              <img class="r10 fl" src="/resources/img/eg_user_img.png" /><span class="fz14 ml5 fl"><a href="#">${user.comp}</a></span>
	                             </#if>
                                </p>
                              </#if>
                            </#list>	
                          </li>
                       </#list>
                    </ul>
                   <div id="Pagination" class="page_box mb40"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="fm980 clearfix">
            <div class="foot_link foot_link1 fl">
                <a href="/creative_list.html">形象创意</a>
                <a href="/script_list.html">剧本创作</a>
                <a href="/render_index.html">动画渲染</a>
                <a href="/creative_helper.html" >创意助手</a>
            </div>
            <div class="foot_link foot_link2 fl">
                <a href="http://zjusp.zju.edu.cn/">浙大科技园</a>
                <a href="http://www.zju.edu.cn/">浙江大学</a>
                <a href="/about.html" >关于我们</a>
            </div>
            <div class="copy_box fr">
                <img class="mb5" src="/resources/img/foot_text.png" />
                <p>&copy; 2013-2016 All right reserved</p>
                <p><a href="">服务条款</a><a href="">隐私条款</a><a href="">法律条款</a></p>
                <p style="display:none;"><a href="" class="share_icon share_sina"></a><a href="" class="share_icon share_wx"></a></p>
            </div>
        </div>
    </div>
<script type="text/javascript">
$("#submitBtn").click(function(){
	$("#search_form").submit();
	/*
	if($.trim($("input[name=keyword]").val())!= "")
	{
		$("#search_form").submit();
	}
	else if($.trim($("input[name=keyword]").val())== "")
	{
		$("#search_form").submit();
	}
	*/
});

//画板搜索
$('.searchBtn').click(function(e){
	//var json={"code": 1, "data": [[132, 177], [107, 171], [131, 176], [141, 179], [145, 181], [109, 171], [128, 176], [127, 175], [135, 177], [120, 174]]};
 	/*
	var json={"code": 1, "data": [[121, 186]]};
	showCreative(json.data);
   */ 
    $.ajax({ type: "POST",
        data: {drawData : $("#whiteboard0")[0].toDataURL()},
        url: 'http://www.50bus.cn/query_image',
        beforeSend:function(){
        	$("#loading").show();
        },
        success: function(d) {
        	var data=d.data;
        	showCreative(data);
        },
        complete:function(){
        	$("#loading").hide();
        },
    });
   
});

function showCreative(data){
	if(data!=null){
		for(var i=0; i<data.length; i++){
			$("#mids").val($("#mids").val()+","+data[i][0]);
	  	}
  	}
	//
	$("#search_form").submit();
}

$(".slides").mousedown(function(){
	$(".def_txt").hide();
});

/*$(function(){
	$('.sc_type_box').click(function(){
		if($('.selbox').is(':hidden')){
			$('.selbox').show();
		}else{
			$('.selbox').hide();
		};
	});
	$('.selbox li').click(function(){
		var val = $(this).html();
		$('.sc_type_box').html(val);
		$('.selbox').hide();
		$("#search_type").val(val);
	});
});*/
$(function(){
	var initPagination = function() {
		$("#Pagination").pagination(${totalCount}, {
			num_edge_entries: 2, //边缘页数
			num_display_entries: 4, //主体页数
			callback: pageselectCallback,
			items_per_page:${pageSize}, //每页显示创意数量
			current_page:${pageIndex}-1,
			prev_text:"<",
			next_text:">",
			ellipse_text:"...",
			prev_show_always:true,
			next_show_always:true,
			async:false
		});
	 }();
	function pageselectCallback(current_page, panel){
		location.href = "/creative_list.html?keyword=${RequestParameters.keyword!''}&pageIndex="+(current_page+1);
	}
});
</script>

<script type="text/javascript" src="/resources/js/page-creative-list.js"></script>
<script type="text/javascript">
	<#if uid??&&uid!="">
    	$.post("/common/getUserName.json",{"uid":${uid}},function(data){
    		if(data.name){
    			$('a[href="/user/user_work.html"]').html(data.name+"个人空间");
    		}
    	});
	 </#if>
</script>
</body>
</html>